package com.example.Annocation.value.Values;

import com.example.Annocation.value.commons.Person;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.Environment;

/**
 * @Description TODO
 * @Date 2024/5/15 11:03
 * @Created by houjunfeng
 */
public class ValueTest {
    AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(ValueConfigeration.class);
    @Test
    public void test01(){
        Person person = annotationConfigApplicationContext.getBean(Person.class);
        System.out.println(person);
        Environment environment = annotationConfigApplicationContext.getEnvironment();
        String property = environment.getProperty("person.name");
        System.out.println(property);
        annotationConfigApplicationContext.close();
    }
}
